import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/pages/home/Home'
import Contacts from '@/pages/contacts/Contacts'
import chatRoom from '@/pages/chatRoom/chatRoom'
import login from '@/pages/login/login'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/login',
      name: 'login',
      alias:'/',//别名 自定义到login接口
      component: login
    },
    {
      path: '/home/:username',
      name: 'Home',
      component: Home
    },
    {
      path: '/contacts',
      name: 'Contacts',
      component: Contacts
    },{
      path: '/chatRoom/:id',
      name: 'chatRoom',
      component: chatRoom
    }
  ]
})
